﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace SYH.Public.BLL
{
   public  class Public_FriendLink
    {
        public static readonly SYH.Public.DAL.Public_FriendLink dal = new DAL.Public_FriendLink();

        #region 基本方法
        /// <summary>
        /// 是否存在该记录
        /// </summary>
        public static bool Exists(int Id)
        {
            return dal.Exists(Id);
        }

        /// <summary>
        /// 增加一条数据
        /// </summary>
        public static int Add(SYH.Public.Model.Public_FriendLink model)
        {
            return dal.Add(model);
        }

        /// <summary>
        /// 更新一条数据
        /// </summary>
        public static bool Update(SYH.Public.Model.Public_FriendLink model)
        {
            return dal.Update(model);
        }

        /// <summary>
        /// 删除一条数据
        /// </summary>
        public static bool Delete(int Id)
        {
            return dal.Delete(Id);
        }

        /// <summary>
        /// 批量删除数据
        /// </summary>
        public static bool DeleteList(string Idlist)
        {
            return dal.DeleteList(Idlist);
        }

        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public static SYH.Public.Model.Public_FriendLink GetModel(int Id)
        {
            return dal.GetModel(Id);
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public static DataSet GetList(string strWhere)
        {
            return dal.GetList(strWhere);
        }
        /// <summary>
        /// 获得前几行数据
        /// </summary>
        public static DataSet GetList(int Top, string strWhere, string filedOrder)
        {
            return dal.GetList(Top, strWhere, filedOrder);
        }
        #endregion

        #region 更新一个字段
        /// <summary>
        /// 更新一个字段
        /// </summary>
        /// <param name="name">字段名</param>
        /// <param name="value">值</param>
        /// <param name="strWhere">条件</param>
        /// <param name="flag">字符串表示：true为字符串；false为整型、bool、日期等</param>
        /// <returns></returns>
        public static bool UpdateOneField(string name, string value, string strWhere, bool flag)
        {
            return dal.UpdateOneField(name, value, strWhere, flag);
        }
        #endregion

        #region 分页数据
        /// <summary>
        ///分页数据
        /// </summary>
        /// <param name="pageSize"></param>
        /// <param name="pageIndex"></param>
        /// <param name="strCondition"></param>
        /// <param name="pageCount"></param>
        /// <param name="recordCount"></param>
        /// <returns></returns>
        public static DataTable GetPageData(int pageSize, int pageIndex, string strCondition, out int pageCount, out int recordCount)
        {
            return dal.GetPageData(pageSize, pageIndex, strCondition, out pageCount, out recordCount);
        }
        #endregion
    }
}
